* {
  padding: 0;
  margin: 0;
}

.map {
  width: 600px;
  height: 400px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  padding: 2px;
  background-color: #333;
}

.grid {
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  background-color: black;
  border: 2px solid #666;
}

.food {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  top: 200px;
  left: 200px;
  margin: 8px;
  box-sizing: border-box;
  transform: translate(-12%, -12%);
  animation: 2s glow infinite;
}

/* 食物发光的动画*/
@keyframes glow {
  0% {
    box-shadow: 0 0 10px 5px #dad0d0;
  }
  50% {
    box-shadow: 0 0 50px 10px #dad0d0;
  }
  100% {
    box-shadow: 0 0 10px 5px #dad0d0;
  }
}

.snake_body {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: absolute;
  top: 200px;
  left: 200px;
  box-sizing: border-box;
  background-color: #c08415;
  transform: translate(13%, 14%);
}
.snake_header {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: absolute;
  top: 200px;
  left: 220px;
  box-sizing: border-box;
  background-color: #ffb123;
  transform: translate(13%, 14%);
}

.plane {
  position: absolute;
  left: -120px;
  display: flex;
  flex-direction: column;
}

.plane span {
  font-size: 20px;
  color: #fff;
  text-align: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 5px;
  cursor: pointer;
  background-color: #c08415;
}

.plane span:hover {
  background-color: #ffb123;
}